<div class="panel panel-default panel-intro">
    {:build_heading()}

    <div class="panel-body">
        <div id="myTabContent" class="tab-content">
            <div class="tab-pane fade active in" id="one">
                <div class="widget-body no-padding">
                    <div id="toolbar" class="toolbar">
                        {:build_toolbar('refresh,del')}
                    </div>
                    <table id="table" class="table table-striped table-bordered table-hover"
                           data-operate-edit="false"
                           data-operate-del="{:$auth->check('dormitory/album/del')}"
                           width="100%">
                    </table>
                </div>
            </div>

        </div>
    </div>
</div>

<script id="gardenTpl" type="text/html">
    <div class="row">
        <div class="col-xs-12">
            <div class="form-inline" data-toggle="cxselect" data-selects="garden_number,building_number,dorm_number">
                <input type="hidden" class="operate" data-name="a.garden_number" id="garden_number" value="=" />
                <input type="hidden" class="operate" data-name="a.building_number" id="building_number" value="=" />

                <select class="garden_number form-control" name="a.garden_number" data-url="dormitory/garden/cxSelect"></select>
                <select class="building_number form-control" name="a.building_number" data-url="dormitory/building/cxSelect" data-query-name="garden_number"></select>
                <select class="dorm_number form-control" name="a.dorm_number" data-url="dormitory/dorm/cxSelect" data-query-name="building_number"></select>
            </div>
        </div>
    </div>
</script>

<script id="itemtpl" type="text/html">
    <!--
    如果启用了templateView,默认调用的是itemtpl这个模板，可以通过设置templateFormatter来修改
    在当前模板中可以使用三个变量(item:行数据,i:当前第几行,data:所有的行数据)
    此模板引擎使用的是art-template的native,可参考官方文档
    -->

    <div class="col-sm-4 col-md-2">
        <div class="thumbnail">
            <img src="<%=item.url%>" style="width: 100%;" alt="">

            <div class="caption">
                <p class="text-muted">园区:<%=item.garden_name%></p>
                <p class="text-muted">楼栋:<%=item.building_name%></p>
                <p class="text-muted">寝室:<%=item.dorm_number%></p>
                <p>
                    <!--如果需要响应编辑或删除事件，可以给元素添加 btn-edit或btn-del的类和data-id这个属性值-->
                    <!--<a href="#" class="btn btn-primary btn-edit" data-id="<%=item.id%>"><i class="fa fa-pencil"></i> 转移相册</a>-->
                    <a href="#" class="btn btn-danger btn-del" data-id="<%=item.id%>"><i class="fa fa-times"></i> 删除</a>
                    <span class="pull-right" style="margin-top:10px;">
                        <!--如果需要多选操作，请确保有下面的checkbox元素存在,可移除-->
                        <input name="checkbox" data-id="<%=item.id%>" type="checkbox" />
                    </span>
                </p>
            </div>
        </div>
    </div>
</script>
